import type { IResponseBody } from "@/common/Responsetypes";
import http from "./request";

export function login(data: object): Promise<IResponseBody<object>> {
  return http.post("/users/login", data);
}

export function whoami(): Promise<IResponseBody<object>> {
  return http.get("/users/whoami");
}

export function register(data: object): Promise<IResponseBody<object>> {
  return http.post("/users/register", data);
}

export function modifyPassword(data: object): Promise<IResponseBody<object>> {
  return http.put("/users/modifyPassword", data);
}
